package com.cqut.ktpspring.service.impl;

import com.cqut.ktpspring.mapper.MessageMapper;
import com.cqut.ktpspring.pojo.Message;
import com.cqut.ktpspring.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageServiceimpl implements MessageService {
    @Autowired
    private MessageMapper messageMapper;
    @Override
    public int getNotReadCount(String receiveId) {
        return messageMapper.getNotReadCount(receiveId);
    }

    @Override
    public List<Message> getMessages(String receiveId, Integer status) {
        return messageMapper.getMessages(receiveId,status);
    }

    @Override
    public void send(Message message) {
        messageMapper.insert(message);
    }

    @Override
    public void read(List<String> ids) {
        messageMapper.read(ids);
    }

}
